package com.meida.module.bus.provider.service.impl;

import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.common.mybatis.query.CriteriaSave;
import com.meida.common.utils.FlymeUtils;
import com.meida.module.bus.client.entity.TJson;
import com.meida.module.bus.provider.mapper.TJsonMapper;
import com.meida.module.bus.provider.service.TJsonService;
import com.meida.common.mybatis.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 测试接口实现类
 *
 * @author flyme
 * @date 2020-02-28
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class TJsonServiceImpl extends BaseServiceImpl<TJsonMapper, TJson> implements TJsonService {

    @Override
    public ResultBody beforeAdd(CriteriaSave cs, TJson json, EntityMap extra) {
        return ResultBody.ok();
    }



    @Override
    @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
    public ResultBody beforePageList(CriteriaQuery<TJson> cq, TJson json, EntityMap requestMap) {
      cq.orderByDesc("json.createTime");
      return ResultBody.ok();
    }
}
